package com.reus.core.util;

import lombok.Getter;

import java.time.format.DateTimeFormatter;

/**
 * description: 格式化时间枚举
 * copyright: Copyright (c) 2018-2021
 * company: iSysCore Tech. Co., Ltd.
 *
 * @author liuxq@isyscore.com
 * @version 1.0
 * @date 2021-09-28 10:59:20
 */
public enum DateTimes implements DefaultDateTime {
    COMMON_DATE_TIME("yyyy-MM-dd HH:mm:ss"),
    COMMON_DATE_MINUTE("yyyy-MM-dd HH:mm"),
    COMMON_DATE("yyyy-MM-dd"),
    COMMON_MONTH("yyyy-MM"),
    COMMON_TIME("HH:mm:ss"),
    COMMON_MINUTE("HH:mm"),

    NUMERIC_DATE_TIME("yyyyMMddHHmmss"),
    NUMERIC_DATE_MINUTE("yyyyMMddHHmm"),
    NUMERIC_DATE("yyyyMMdd"),
    NUMERIC_MONTH("yyyyMM"),
    NUMERIC_TIME("HHmmss"),
    NUMERIC_MINUTE("HHmm"),

    CHN_DATE_TIME("yyyy年MM月dd日 HH时mm分ss秒"),
    CHN_DATE_MINUTE("yyyy年MM月dd日 HH时mm分"),
    CHN_DATE("yyyy年MM月dd日"),
    CHN_MONTH_DATE("MM月dd日"),
    CHN_MONTH("yyyy年MM月"),
    CHN_TIME("HH时mm分ss秒"),
    CHN_MINUTE("HH时mm分");

    @Getter
    private final String pattern;
    @Getter
    public final DateTimeFormatter formatter;

    DateTimes(String pattern) {
        this.pattern = pattern;
        this.formatter = DateTimeFormatter.ofPattern(pattern);
    }

}
